<?php
/**
 * @package Framework
 * @subpackage Controls
 */

/**
 * Create a hyperlink
 * 
 * @package Framework
 * @subpackage Controls
 * @desc 创建一个超级链接
 * @access public
 */
require_once($GO_CONFIG->class_path.'base/controls/html_element.class.inc');

class hyperlink extends html_element
{
	var $innerHTML = '';		
	
	function hyperlink($href, $innerHTML, $title='')
	{
		$this->innerHTML=$innerHTML;
		
		if(!empty($href))
		{
			$this->set_attribute('href', $href);
		}
		
		if(!empty($title))
		{
			$this->set_attribute('title', $title);
		}
	}	
	
	function get_html()
	{	
		$html = '<a';
		foreach($this->attributes as $name=>$value)
		{
			$html .= ' '.$name.'="'.$value.'"';
		}
		$html .= '>'.$this->innerHTML.'</a>';
		
		return $html;
	}
}
